package ua.kratik.seabattle.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import ua.kratik.seabattle.dao.DataObject;

@Entity
@Table (name = "battleShots")
public class BattleShot implements DataObject{
	
	@Id
	@Column
	private Integer shotNumber;
	
	@ManyToOne(fetch = FetchType.LAZY, optional = false)
	@JoinColumn(name = "battles_id")
	private Battle battle;
	
	@ManyToOne(fetch = FetchType.LAZY, optional = false)
	@JoinColumn(name = "admirals_id")
	private User user;
	
	@Column
	private Integer shotX;
	
	@Column
	private Integer shotY;
	
	@ManyToOne(fetch = FetchType.LAZY, optional = false)
	@JoinColumn(name = "shortResult_id")
	private ShotResult shotResult;

	public Integer getShotNumber() {
		return shotNumber;
	}

	public void setShotNumber(Integer shotNumber) {
		this.shotNumber = shotNumber;
	}

	public Battle getBattle() {
		return battle;
	}

	public void setBattle(Battle battle) {
		this.battle = battle;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Integer getShotX() {
		return shotX;
	}

	public void setShotX(Integer shotX) {
		this.shotX = shotX;
	}

	public Integer getShotY() {
		return shotY;
	}

	public void setShotY(Integer shotY) {
		this.shotY = shotY;
	}

	public ShotResult getShotResult() {
		return shotResult;
	}

	public void setShotResult(ShotResult shotResult) {
		this.shotResult = shotResult;
	}

}
